﻿IF OBJECT_ID('InvTuiXueMingXi', 'U') IS NULL
    CREATE TABLE dbo.InvTuiXueMingXi (
        Id              BIGINT NOT NULL,                         -- 主键Id
        invTuiXueId     VARCHAR(128) NOT NULL,                   -- 协议医院退血表Id
        xueYeId         BIGINT NOT NULL                          -- 血液Id
    );
GO

-- 主键约束
ALTER TABLE InvTuiXueMingXi ADD CONSTRAINT pk_invTuiXueMingXi PRIMARY KEY CLUSTERED (Id);
GO

-- 添加表和列注释
IF OBJECT_ID('InvTuiXueMingXi', 'U') IS NOT NULL
BEGIN
    EXEC sp_addcomment 'InvTuiXueMingXi', '协议医院退血明细表', '', '';
    EXEC sp_addcomment 'InvTuiXueMingXi', '', 'Id', '主键Id';
    EXEC sp_addcomment 'InvTuiXueMingXi', '', 'invTuiXueId', '协议医院退血表Id';
    EXEC sp_addcomment 'InvTuiXueMingXi', '', 'xueYeId', '血液Id';
END
GO